package com.jack.qpsflow;

/**
 * Created by JackGe on 2017/7/9.
 */
public class QPSFlowBuilder {

    private int share = 1;      //
    private int qps = 1;        //
    private RemoveListener listener = null;

    public int getShare() {
        return share;
    }

    public QPSFlowBuilder setShare(int share) {
        this.share = share;
        return this;
    }

    public int getQps() {
        return qps;
    }

    public QPSFlowBuilder setQps(int qps) {
        this.qps = qps;
        return this;
    }

    public RemoveListener getListener() {
        return listener;
    }

    public QPSFlowBuilder setListener(RemoveListener listener) {
        this.listener = listener;
        return this;
    }

    public QPSFlow build() {
        QPSFlow flow = new QPSFlow();
        flow.setQps(this.qps).setShare(Math.max(1, this.share)).setListener(this.listener).init();
        return flow;
    }
}
